/*
+--------------------------------------------------------------------------
|   Mblog [#RELEASE_VERSION#]
|   ========================================
|   Copyright (c) 2014, 2015 mtons. All Rights Reserved
|   http://www.mtons.com
|
+---------------------------------------------------------------------------
*/
package com.hefei.blog.admin.persist.service;

import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hefei.blog.admin.data.Admin;
import com.hefei.blog.admin.data.AdminProfile;
import com.hefei.blog.admin.data.AuthMenu;
import com.hefei.blog.base.paging.Paging;

public interface AdminService {
	
	public String login(String loginName,String password,HttpServletRequest request,HttpServletResponse response);
	
	public void writeLoginCookie(AdminProfile profile, HttpServletRequest request,HttpServletResponse response) throws Exception;
	
	/**
	 * 登录
	 * @param username
	 * @param password
	 * @return
	 */
	AdminProfile login(String username, String password);

	

	/**
	 * 查询单个用户
	 * @param id
	 * @return
	 */
	Admin get(long id);

	Admin getByUsername(String username);

	public AdminProfile getProfile(Long userId);
	
	
//	/**
//	 * 修改密码
//	 * @param id
//	 * @param newPassword
//	 */
//	void updatePassword(long id, String newPassword);
//
//	/**
//	 * 修改密码
//	 * @param id
//	 * @param oldPassword
//	 * @param newPassword
//	 */
//	void updatePassword(long id, String oldPassword, String newPassword);
//
//	/**
//	 * 修改用户状态
//	 * @param id
//	 * @param status
//	 */
//	void updateStatus(long id, int status);

	void updateRole(long id, Long[] roleIds);

	/**
	 * 分页查询
	 * @param paging
	 */
	void paging(Paging paging, String key);

	Map<Long, Admin> findMapByIds(Set<Long> ids);

	List<AuthMenu> getMenuList(long id);
}
